import request from "@/utils/request"

export default{
    /**
     * query 分类名字，状态
     * current 当前的页码，默认第一页
     * size 一页请求多少条
     */
    getList(query,current = 1,size = 20){
        return request({
            url:`/article/category/search`,
            method:"post",
            data:{ 
                ...query,
                current,
                size
            }
        })
    },
    add(data){
        return request({
            url:`/article/category`,
            method:"post",
            data:data
        })
    },
    //查询类别详情
    getByID(id){
        return request({
            url:`/article/category/${id}`,
            method:"get",
        })
    },
    //类别数据更新
    update(data){
        return request({
            url:`/article/category`,
            method:"put",
            data:data
        })
    },
    //删除
    deleteById(id){
        return request({
            url:`/article/category/${id}`,
            method:"delete",
        })
    },
   //查询正常状态的分类
   getNormalList(){
    return request({
        url: `/article/category/list`,
        method: 'get'
    })
}

}